﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutBase.cshtml";
}
@section styles{
    <link href="@Url.Content("~/Content/CSS/common/bootstrap-table/bootstrap-table.min.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/CSS/common/animate/animate.min.css")" rel="stylesheet" />
}
<div id="dMain">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox" style="margin-bottom: 0px;">
            <div class="ibox-title">
                <h4>公告管理</h4>
            </div>
            <div class="ibox-content">
                <div class="dSearch">
                    <select name="ddlFTerm" id="ddlFTerm" class="form-control" style="width:100px;">
                        <option selected="selected" value="">-- 签收 --</option>
                        <option value="A">全部</option>
                        <option value="Y">已签收</option>
                        <option value="C">未签收</option>
                    </select>
                    <select name="ddlFTerm" id="ddlFTerm" class="form-control" style="width:100px;">
                        <option selected="selected" value="">-- 类型 --</option>
                        <option value="Y">全部</option>
                        <option value="C">系统内部</option>
                        <option value="D">网外导入</option>
                        <option value="2">其它</option>
                    </select>
                    <input name="txtFileNo" type="text" id="txtFileNo" class="form-control" placeholder="文号" style="width:150px;" autocomplete="off">
                    <input name="txtND1" type="text" id="txtND1" class="form-control" placeholder="接收日期" onclick="WdatePicker({dateFmt: 'yyyy'})" style="width:85px;" autocomplete="off">
                    至
                    <input name="txtND2" type="text" id="txtND2" class="form-control" placeholder="接收日期" onclick="WdatePicker({dateFmt: 'yyyy'})" style="width:85px;" autocomplete="off">

                    <input name="txtAY" type="text" id="txtAY" class="form-control" placeholder="标题" style="width:300px;" autocomplete="off">
                    <a id="lbtnSearch" class="btn btn-sm btn-primary btn-success"><i class="iconfont icon-sousuo"></i>&nbsp;快速检索</a>
                </div>
                <div id="toolbar">
                    <a class="btn btn-sm btn-primary btn-info radius" onclick="parent.createTab('0081','导入外网公文','@Url.Action("Create","Notify",new { area="Common"})')" style="margin-top: 10px;"><i class="iconfont icon-tianjia"></i>&nbsp; 新建公告</a>
                    <a class="btn btn-sm btn-primary btn-danger radius" onclick="LitigationPrint()" style="margin-top: 10px; margin-left: 10px;"><i class="iconfont icon-shanchu1"></i> &nbsp;删除所选公告</a>
                    <div class="text-danger" style="font-size: 14px; margin-top: 15px;margin-left: 10px;float:right; "><i class="iconfont icon-tuichiweixuan"></i>&nbsp;提示：双击行可查看该公告通知的详细信息！</div>
                </div>
                <table id="NotifyDataTable"></table>

            </div>
        </div>
    </div>
</div>

@section scripts{
    <script src="@Url.Content("~/Content/JS/common/bootstrap-table/bootstrap-table.min.js")"></script>
    <script src="@Url.Content("~/Content/JS/common/bootstrap-table/locale/bootstrap-table-zh-CN.min.js")"></script>
    <script src="@Url.Content("~/Content/JS/common/bootstrap-table/bootstrap-table-export.js")"></script>
    <script src="@Url.Content("~/Content/JS/common/bootstrap-table/tableExport.js")"></script>
    <script src="@Url.Content("~/Content/JS/common/bootstrap-table/bootstrap-table-cookie.js")"></script>
    <script>
        var tabHeight = 0;
        $(function () {
            $('#NotifyDataTable').bootstrapTable({
                height: tabHeight + 50,
                url: '/Notify/GetTableJsonResult',         //请求后台的URL（*）
                method: 'get',                      //请求方式（*）
                //data: $("#dJson").text() != "" ? JSON.parse($("#dJson").text()) : "",
                dataType: "json",
                columns: [
                    { align: 'center', width: "50px", checkbox: true },
                    { title: "发文人", field: 'FileNo', align: 'left', width: "100px", sortable: true },
                    { title: "类型", field: 'CaseTypeB', align: 'center', width: "70px", sortable: true },
                    { title: "文号", field: 'OrgName', align: 'left', width: "150px", sortable: true },
                    { title: "标题", field: 'TYSAH', align: 'left', sortable: true },
                    { title: "发布时间", field: 'DangHao', align: 'left', width: "150px", sortable: true },
                    { title: "签收人", field: 'LaiYuan', align: 'left', width: "100px" },
                    { title: "签收时间", field: 'CaseCause', align: 'left', width: "100px" },               
                    { title: "状态", field: 'LaiYuan', align: 'left', width: "50px" },
                    {
                        title: "操作",
                        align: 'center',
                        valign: 'middle',
                        formatter: function (value, row, index) {
                            return '<button class="btn btn-sm btn-primary " onclick="del(\'' + row.stdId + '\')">删除</button>';
                        }
                    }
                ],
                toolbar: '#toolbar',//工具按钮用哪个容器
                buttonsClass: "sm btn-white",//按钮class
                pageSize: 15,//分页条数
                clickToSelect: false,//设置true 将在点击行时，自动选择单选或复选框
                singleSelect: false,//为true则禁止多选
                cache: false,//是否缓存
                cookie: true,//是否启用cookie
                cookieIdTable: "Notify",//cookie键值
                pagination: true,//是否分页
                showColumns: true,//是否显示所有的列
                showRefresh: true,//是否显示刷新按钮
                search: false,//是否启用搜索
                showPaginationSwitch: true,//是否显示分页切换按钮
                showExport: true,//是否启用导出
                striped: false,//是否显示行间隔色
                detailView: false,//是否显示切换视图列
                //detailFormatter: detailFormatter,//卡片视图内容格式化
                onDblClickRow: function (row, obj) { //双击行事件
                    window.top.showFullPage("图像阅读器（" + (row.FileNo) + "）", "/See.aspx?FID=" + row.ID);
                },
                onClickRow: function (row, obj) { //单击行事件
                    $(obj).parent().find("tr").removeClass("selected");
                    $(obj).addClass("selected");

                    //根据选中的行获取子表数据
                    GetSonData(row.ID);
                },
                onSearch: function (text) {
                    if (text != "") {
                        $("#tabData tbody tr td:not(.bs-checkbox)").each(function (i) {
                            var str = "<span class=\"bg-yellow\">" + text + "</span>";
                            var NewText = $("#tabData tbody tr td:not(.bs-checkbox)").eq(i).text().replaceAll(text, str);
                            $("#tabData tbody tr td:not(.bs-checkbox)").eq(i).html(NewText);
                        })
                    }
                }
            });
        })

    </script>
}

